home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Varios Español
/
Varios Español.iso
/
DBASE5
/
CUA_SAMP.ZIP
/
SUBMITFM.PRG
< prev
next >
Wrap
Text File
|
1994-10-12
|
2KB
|
44 lines
FUNCTION SubmitFm
PARAMETERS poForm
*----------------------------------------------------------------------------
* NAME
* SubmitFm - Submit the current record. If it fails display a message
* and return .F.
*
* PARAMETERS
* poForm = Object reference to the form
*
*----------------------------------------------------------------------------
PRIVATE cIntlTry, lOk
cIntlTry = [Imposible escribir el registro. Vuelva a intentarlo o cancele la ficha.]
lOk = .T.
*--------------------------------------------------------
*-- Make sure this is a form object before doing anything
*--------------------------------------------------------
IF TYPE( "poForm.Classname" ) = "C" .AND. poForm.Classname = "FORM"
*-----------------------------------------------------------------
*-- If current record was modified, write it, otherwise do nothing
*-----------------------------------------------------------------
IF poForm.Modified()
lOk = poForm.Submit()
*---------------------------------------------------------------
*-- Display an information message if Submit() failed. Submit()
*-- can fail a number of ways. For instance, if the record
*-- lock failed before writing, Submit() returns false.
*-- Submit() also fails if an event handler closed the database
*-- for the form.
*---------------------------------------------------------------
IF .NOT. lOk
DO InfoMsg WITH m->cIntlTry
ENDIF
ENDIF
ENDIF
RETURN lOk
*-- EOP: SubmitFm WITH poForm